3.486 \(\int \sqrt {a+a \sec (c+d x)} (A+B \sec (c+d x)+C \sec ^2(c+d x)) \, dx\)

Optimal. Leaf size=100 \[ \frac {2 \sqrt {a} A \tan ^{-1}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a \sec (c+d x)+a}}\right )}{d}+\frac {2 a (3 B+C) \tan (c+d x)}{3 d \sqrt {a \sec (c+d x)+a}}+\frac {2 C \tan (c+d x) \sqrt {a \sec (c+d x)+a}}{3 d} \]

[Out]

2*A*arctan(a^(1/2)*tan(d*x+c)/(a+a*sec(d*x+c))^(1/2))*a^(1/2)/d+2/3*a*(3*B+C)*tan(d*x+c)/d/(a+a*sec(d*x+c))^(1
/2)+2/3*C*(a+a*sec(d*x+c))^(1/2)*tan(d*x+c)/d

________________________________________________________________________________________

Rubi [A]  time = 0.15, antiderivative size = 100, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 35, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {4054, 3915, 3774, 203, 3792} \[ \frac {2 \sqrt {a} A \tan ^{-1}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a \sec (c+d x)+a}}\right )}{d}+\frac {2 a (3 B+C) \tan (c+d x)}{3 d \sqrt {a \sec (c+d x)+a}}+\frac {2 C \tan (c+d x) \sqrt {a \sec (c+d x)+a}}{3 d} \]

Antiderivative was successfully verified.

[In]

Int[Sqrt[a + a*Sec[c + d*x]]*(A + B*Sec[c + d*x] + C*Sec[c + d*x]^2),x]

[Out]

(2*Sqrt[a]*A*ArcTan[(Sqrt[a]*Tan[c + d*x])/Sqrt[a + a*Sec[c + d*x]]])/d + (2*a*(3*B + C)*Tan[c + d*x])/(3*d*Sq
rt[a + a*Sec[c + d*x]]) + (2*C*Sqrt[a + a*Sec[c + d*x]]*Tan[c + d*x])/(3*d)

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 3774

Int[Sqrt[csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_)], x_Symbol] :> Dist[(-2*b)/d, Subst[Int[1/(a + x^2), x], x, (b*C
ot[c + d*x])/Sqrt[a + b*Csc[c + d*x]]], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0]

Rule 3792

Int[csc[(e_.) + (f_.)*(x_)]*Sqrt[csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)], x_Symbol] :> Simp[(-2*b*Cot[e + f*x])/
(f*Sqrt[a + b*Csc[e + f*x]]), x] /; FreeQ[{a, b, e, f}, x] && EqQ[a^2 - b^2, 0]

Rule 3915

Int[Sqrt[csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)]*(csc[(e_.) + (f_.)*(x_)]*(d_.) + (c_)), x_Symbol] :> Dist[c, In
t[Sqrt[a + b*Csc[e + f*x]], x], x] + Dist[d, Int[Sqrt[a + b*Csc[e + f*x]]*Csc[e + f*x], x], x] /; FreeQ[{a, b,
 c, d, e, f}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0]

Rule 4054

Int[((A_.) + csc[(e_.) + (f_.)*(x_)]*(B_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_.))*(csc[(e_.) + (f_.)*(x_)]*(b_.) +
 (a_))^(m_.), x_Symbol] :> -Simp[(C*Cot[e + f*x]*(a + b*Csc[e + f*x])^m)/(f*(m + 1)), x] + Dist[1/(b*(m + 1)),
 Int[(a + b*Csc[e + f*x])^m*Simp[A*b*(m + 1) + (a*C*m + b*B*(m + 1))*Csc[e + f*x], x], x], x] /; FreeQ[{a, b,
e, f, A, B, C, m}, x] && EqQ[a^2 - b^2, 0] &&  !LtQ[m, -2^(-1)]

Rubi steps

\begin {align*} \int \sqrt {a+a \sec (c+d x)} \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx &=\frac {2 C \sqrt {a+a \sec (c+d x)} \tan (c+d x)}{3 d}+\frac {2 \int \sqrt {a+a \sec (c+d x)} \left (\frac {3 a A}{2}+\frac {1}{2} a (3 B+C) \sec (c+d x)\right ) \, dx}{3 a}\\ &=\frac {2 C \sqrt {a+a \sec (c+d x)} \tan (c+d x)}{3 d}+A \int \sqrt {a+a \sec (c+d x)} \, dx+\frac {1}{3} (3 B+C) \int \sec (c+d x) \sqrt {a+a \sec (c+d x)} \, dx\\ &=\frac {2 a (3 B+C) \tan (c+d x)}{3 d \sqrt {a+a \sec (c+d x)}}+\frac {2 C \sqrt {a+a \sec (c+d x)} \tan (c+d x)}{3 d}-\frac {(2 a A) \operatorname {Subst}\left (\int \frac {1}{a+x^2} \, dx,x,-\frac {a \tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{d}\\ &=\frac {2 \sqrt {a} A \tan ^{-1}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{d}+\frac {2 a (3 B+C) \tan (c+d x)}{3 d \sqrt {a+a \sec (c+d x)}}+\frac {2 C \sqrt {a+a \sec (c+d x)} \tan (c+d x)}{3 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.83, size = 101, normalized size = 1.01 \[ \frac {\sec \left (\frac {1}{2} (c+d x)\right ) \sec (c+d x) \sqrt {a (\sec (c+d x)+1)} \left (3 \sqrt {2} A \sin ^{-1}\left (\sqrt {2} \sin \left (\frac {1}{2} (c+d x)\right )\right ) \cos ^{\frac {3}{2}}(c+d x)+2 \sin \left (\frac {1}{2} (c+d x)\right ) ((3 B+2 C) \cos (c+d x)+C)\right )}{3 d} \]

Antiderivative was successfully verified.

[In]

Integrate[Sqrt[a + a*Sec[c + d*x]]*(A + B*Sec[c + d*x] + C*Sec[c + d*x]^2),x]

[Out]

(Sec[(c + d*x)/2]*Sec[c + d*x]*Sqrt[a*(1 + Sec[c + d*x])]*(3*Sqrt[2]*A*ArcSin[Sqrt[2]*Sin[(c + d*x)/2]]*Cos[c
+ d*x]^(3/2) + 2*(C + (3*B + 2*C)*Cos[c + d*x])*Sin[(c + d*x)/2]))/(3*d)

________________________________________________________________________________________

fricas [A]  time = 0.51, size = 304, normalized size = 3.04 \[ \left [\frac {3 \, {\left (A \cos \left (d x + c\right )^{2} + A \cos \left (d x + c\right )\right )} \sqrt {-a} \log \left (\frac {2 \, a \cos \left (d x + c\right )^{2} - 2 \, \sqrt {-a} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \cos \left (d x + c\right ) \sin \left (d x + c\right ) + a \cos \left (d x + c\right ) - a}{\cos \left (d x + c\right ) + 1}\right ) + 2 \, {\left ({\left (3 \, B + 2 \, C\right )} \cos \left (d x + c\right ) + C\right )} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \sin \left (d x + c\right )}{3 \, {\left (d \cos \left (d x + c\right )^{2} + d \cos \left (d x + c\right )\right )}}, -\frac {2 \, {\left (3 \, {\left (A \cos \left (d x + c\right )^{2} + A \cos \left (d x + c\right )\right )} \sqrt {a} \arctan \left (\frac {\sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \cos \left (d x + c\right )}{\sqrt {a} \sin \left (d x + c\right )}\right ) - {\left ({\left (3 \, B + 2 \, C\right )} \cos \left (d x + c\right ) + C\right )} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \sin \left (d x + c\right )\right )}}{3 \, {\left (d \cos \left (d x + c\right )^{2} + d \cos \left (d x + c\right )\right )}}\right ] \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*sec(d*x+c)+C*sec(d*x+c)^2)*(a+a*sec(d*x+c))^(1/2),x, algorithm="fricas")

[Out]

[1/3*(3*(A*cos(d*x + c)^2 + A*cos(d*x + c))*sqrt(-a)*log((2*a*cos(d*x + c)^2 - 2*sqrt(-a)*sqrt((a*cos(d*x + c)
 + a)/cos(d*x + c))*cos(d*x + c)*sin(d*x + c) + a*cos(d*x + c) - a)/(cos(d*x + c) + 1)) + 2*((3*B + 2*C)*cos(d
*x + c) + C)*sqrt((a*cos(d*x + c) + a)/cos(d*x + c))*sin(d*x + c))/(d*cos(d*x + c)^2 + d*cos(d*x + c)), -2/3*(
3*(A*cos(d*x + c)^2 + A*cos(d*x + c))*sqrt(a)*arctan(sqrt((a*cos(d*x + c) + a)/cos(d*x + c))*cos(d*x + c)/(sqr
t(a)*sin(d*x + c))) - ((3*B + 2*C)*cos(d*x + c) + C)*sqrt((a*cos(d*x + c) + a)/cos(d*x + c))*sin(d*x + c))/(d*
cos(d*x + c)^2 + d*cos(d*x + c))]

________________________________________________________________________________________

giac [B]  time = 1.44, size = 260, normalized size = 2.60 \[ -\frac {\frac {3 \, A \sqrt {-a} a \log \left (\frac {{\left | 2 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{2} - 4 \, \sqrt {2} {\left | a \right |} - 6 \, a \right |}}{{\left | 2 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{2} + 4 \, \sqrt {2} {\left | a \right |} - 6 \, a \right |}}\right ) \mathrm {sgn}\left (\cos \left (d x + c\right )\right )}{{\left | a \right |}} + \frac {2 \, {\left (3 \, \sqrt {2} B a^{2} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) + 3 \, \sqrt {2} C a^{2} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) - {\left (3 \, \sqrt {2} B a^{2} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) + \sqrt {2} C a^{2} \mathrm {sgn}\left (\cos \left (d x + c\right )\right )\right )} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2}\right )} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{{\left (a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - a\right )} \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}}}{3 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*sec(d*x+c)+C*sec(d*x+c)^2)*(a+a*sec(d*x+c))^(1/2),x, algorithm="giac")

[Out]

-1/3*(3*A*sqrt(-a)*a*log(abs(2*(sqrt(-a)*tan(1/2*d*x + 1/2*c) - sqrt(-a*tan(1/2*d*x + 1/2*c)^2 + a))^2 - 4*sqr
t(2)*abs(a) - 6*a)/abs(2*(sqrt(-a)*tan(1/2*d*x + 1/2*c) - sqrt(-a*tan(1/2*d*x + 1/2*c)^2 + a))^2 + 4*sqrt(2)*a
bs(a) - 6*a))*sgn(cos(d*x + c))/abs(a) + 2*(3*sqrt(2)*B*a^2*sgn(cos(d*x + c)) + 3*sqrt(2)*C*a^2*sgn(cos(d*x +
c)) - (3*sqrt(2)*B*a^2*sgn(cos(d*x + c)) + sqrt(2)*C*a^2*sgn(cos(d*x + c)))*tan(1/2*d*x + 1/2*c)^2)*tan(1/2*d*
x + 1/2*c)/((a*tan(1/2*d*x + 1/2*c)^2 - a)*sqrt(-a*tan(1/2*d*x + 1/2*c)^2 + a)))/d

________________________________________________________________________________________

maple [B]  time = 2.20, size = 236, normalized size = 2.36 \[ \frac {\sqrt {\frac {a \left (1+\cos \left (d x +c \right )\right )}{\cos \left (d x +c \right )}}\, \left (3 A \sqrt {2}\, \cos \left (d x +c \right ) \sin \left (d x +c \right ) \arctanh \left (\frac {\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sin \left (d x +c \right ) \sqrt {2}}{2 \cos \left (d x +c \right )}\right ) \left (-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}\right )^{\frac {3}{2}}+3 A \arctanh \left (\frac {\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sin \left (d x +c \right ) \sqrt {2}}{2 \cos \left (d x +c \right )}\right ) \sqrt {2}\, \left (-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}\right )^{\frac {3}{2}} \sin \left (d x +c \right )-12 B \left (\cos ^{2}\left (d x +c \right )\right )-8 C \left (\cos ^{2}\left (d x +c \right )\right )+12 B \cos \left (d x +c \right )+4 C \cos \left (d x +c \right )+4 C \right )}{6 d \sin \left (d x +c \right ) \cos \left (d x +c \right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((A+B*sec(d*x+c)+C*sec(d*x+c)^2)*(a+a*sec(d*x+c))^(1/2),x)

[Out]

1/6/d*(a*(1+cos(d*x+c))/cos(d*x+c))^(1/2)*(3*A*arctanh(1/2*(-2*cos(d*x+c)/(1+cos(d*x+c)))^(1/2)*sin(d*x+c)/cos
(d*x+c)*2^(1/2))*(-2*cos(d*x+c)/(1+cos(d*x+c)))^(3/2)*cos(d*x+c)*2^(1/2)*sin(d*x+c)+3*A*arctanh(1/2*(-2*cos(d*
x+c)/(1+cos(d*x+c)))^(1/2)*sin(d*x+c)/cos(d*x+c)*2^(1/2))*(-2*cos(d*x+c)/(1+cos(d*x+c)))^(3/2)*2^(1/2)*sin(d*x
+c)-12*B*cos(d*x+c)^2-8*C*cos(d*x+c)^2+12*B*cos(d*x+c)+4*C*cos(d*x+c)+4*C)/sin(d*x+c)/cos(d*x+c)

________________________________________________________________________________________

maxima [F(-1)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*sec(d*x+c)+C*sec(d*x+c)^2)*(a+a*sec(d*x+c))^(1/2),x, algorithm="maxima")

[Out]

Timed out

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.01 \[ \int \sqrt {a+\frac {a}{\cos \left (c+d\,x\right )}}\,\left (A+\frac {B}{\cos \left (c+d\,x\right )}+\frac {C}{{\cos \left (c+d\,x\right )}^2}\right ) \,d x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + a/cos(c + d*x))^(1/2)*(A + B/cos(c + d*x) + C/cos(c + d*x)^2),x)

[Out]

int((a + a/cos(c + d*x))^(1/2)*(A + B/cos(c + d*x) + C/cos(c + d*x)^2), x)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \sqrt {a \left (\sec {\left (c + d x \right )} + 1\right )} \left (A + B \sec {\left (c + d x \right )} + C \sec ^{2}{\left (c + d x \right )}\right )\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*sec(d*x+c)+C*sec(d*x+c)**2)*(a+a*sec(d*x+c))**(1/2),x)

[Out]

Integral(sqrt(a*(sec(c + d*x) + 1))*(A + B*sec(c + d*x) + C*sec(c + d*x)**2), x)

________________________________________________________________________________________